<!DOCTYPE html>
<html>
	{include file="public/header" /}

	<body>
		<div class="layui-fluid">
			<div class="layui-card">
				<div class="layui-form layui-card-header layuiadmin-card-header-auto">
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">搜索条件</label>
							<div class="layui-input-block">
								<select name="sorch">
									<option value="1" selected="selected">全部</option>
									<option value="2">姓名</option>
									<option value="7">IP</option>
								</select>
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">输入参数</label>
							<div class="layui-input-block">
								<input type="text" name="sorch_aaa" placeholder="请输入" autocomplete="off" class="layui-input">
							</div>
						</div>

						{include file="public/datetime" /}
						<div class="layui-inline">
							<button class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="LAY-user-back-search">
              				<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
            				</button>
						</div>
					</div>
				</div>
				<div class="layui-card-body">
					<div style="padding-bottom: 10px;">
						<table id="LAY-user-back-manage" lay-filter="LAY-user-back-manage"></table>
					</div>
				</div>
			</div>
			{include file="public/footer" /}
			<script>
				layui.use(['index', 'table', 'laydate', 'element'], function() {
					var $ = layui.$,
						form = layui.form,
						table = layui.table;

					//监听搜索
					form.on('submit(LAY-user-back-search)', function(data) {
						var field = data.field;

						//执行重载
						table.reload('LAY-user-back-manage', {
							where: field
						});
					});

					table.render({
						elem: '#LAY-user-back-manage',
						url: "{:url('admin/log/get_list')}",
						toolbar: '#LAY-user-back-manage',
						title: '日志记录',
						height: 'full-300', //最大高度
						cols: [
							[{
									type: 'checkbox',
									fixed: 'left'
								}, {
									field: 'ID',
									title: 'ID',
									width: 80,
									fixed: 'left',
									unresize: true,
									sort: true
								}, {
									field: 'TrueName',
									title: '真实姓名',
									width: 120,
									edit: 'text'
								}, {
									field: 'UserName',
									title: '用户名',
									width: 120,
									edit: 'text'
								},

								{
									field: 'ControllerName',
									title: '控制器',
									width: 180,
									edit: 'text',
								},
								{
									field: 'ActionName',
									title: '方法名',
									width: 180,
									edit: 'text',
								},

								{
									field: 'IP',
									title: '操作IP',
									width: 120,
									edit: 'text'
								},
								{
									field: 'IPCity',
									title: '操作城市',
									width: 160,
									edit: 'text'
								},
								{
									field: 'Des',
									title: '功能',
									width: 160,
									edit: 'text'
								},
								{
									field: 'URL',
									title: '操作地址',
									width: 190,
									edit: 'text'
								},
								{
									field: 'DateTime',
									title: '操作时间',
									width: 180,
									edit: 'text'
								}
							]
						],
						page: true
					});
					$('.layui-btn.layuiadmin-btn-admin').on('click', function() {
						var type = $(this).data('type');
						active[type] ? active[type].call(this) : '';
					});
					var laydate = layui.laydate;
					//日期范围
					laydate.render({
						elem: '#test6',
						range: true
					});
				});
			</script>
	</body>

</html>